<template>
  <div>
    <el-table :data="dataList">
      <el-table-column label="id">
        <template #default="scope">
          <div>
            <span>{{ scope.row.id }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="模块名称">
        <template #default="scope">
          <div>
            <span>{{ scope.row.模块名称 }}</span>
          </div>
        </template>
      </el-table-column>

      <el-table-column label="操作">
        <template #default="scope">
          <div>
            <el-button @click="()=>{triggerModify(scope.row)}">编辑</el-button>
            <el-button>删除</el-button>
          </div>
        </template>
      </el-table-column>

    </el-table>
  </div>
</template>
<script setup>
import axios from "axios";
import { ref, onMounted } from "vue";
import FormDialog from '../../components/FormDialog/index'
const dataList = ref([]);

onMounted(() => {
  initByDialog();
});

async function initByDialog() {
  var result = await axios
    .post("/api/apis", { _name: "getlist", 模块: "个人" })
    .then((res) => res.data);
  console.log("result :", result);
  dataList.value = (result && result.data) || [];
  console.log("dataList.value.ref :", dataList.value);
}

function triggerModify(row){
  FormDialog({
 title:'修改',
components:{
 modify:()=>import('./modify.vue')
}
})
}
</script>
